package com.hunan.api.catv.action.system;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.service.biz.system.SystemDictBiz;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jiang zhuan
 * @version 1.0
 * @description 描述
 * @date 2021/10/14 0014
 * @package com.hunan.api.catv.action.system
 * @company 湖南有线
 */
@RestController
@RequestMapping(Api.systemDic)
public class SystemDicAction extends BaseAction {
    @Autowired
    SystemDictBiz systemDictBiz;

    @GetMapping("/open/{key}")
    public Result getOpenKey(@PathVariable String key) {
        if (StringUtils.isBlank(key)) {
            return buildRequire("key is required");
        }
        return buildOK(systemDictBiz.getOpenKey(key), "");
    }

}
